package com.victor.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.victor.dao.AdvertisementDao;
import com.victor.entity.Advertisement;
import com.victor.service.AdvertisementService;

@Service
public class AdvertisementServiceimpl implements AdvertisementService {

	@Autowired
	private AdvertisementDao advertisementDao;

//	查询列表
	@Override
	public List<Advertisement> getAll() {
		return advertisementDao.getAll();
	}

//	查详情询
	@Override
	public Advertisement findByid(int aid) {
		return advertisementDao.findByid(aid);
	}

//	新建
	@Override
	public boolean insert(Advertisement advertisement) {
		return advertisementDao.insert(advertisement) > 0 ? true : false;
	}

//	修改
	@Override
	public boolean update(Advertisement advertisement) {
		return advertisementDao.update(advertisement) > 0 ? true : false;
	}

//	批量删除
	@Override
	public boolean batchDelete(int[] ids) {
		return advertisementDao.batchDelete(ids) > 0 ? true : false;
	}

//	查询列表(日期查询)
	@Override
	public List<Advertisement> getAdBySearch(String starttime, String endtime,String tiaojian) {
		return advertisementDao.getAdBySearch(starttime,endtime,tiaojian) ;
	}
}
